import { _decorator, Component, Node, RigidBody2D } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('background')
export class background extends Component {
    start() {
    }

    update(deltaTime: number) {
		for (let bgNode of this.node.children) {
			bgNode.setPosition(
				0,
				bgNode.getPosition().y - 150 * deltaTime,
			)
			if (bgNode.getPosition().y <= -852) {
				bgNode.setPosition(
					0,
					bgNode.getPosition().y + 1704
				);
			}
		}
		
    }
}

